var events = require('events');
var Emitter = events.EventEmitter;

function Dog(dogName) {
    Emitter.call(this); //实现对EventEmitter的继承
    this.dogName = dogName;
}
Dog.prototype = Emitter.prototype; //实现对EventEmitter的继承
Dog.prototype.bark = function () {
    console.log(this.dogName + "barked")
}
module.exports = Dog; //将Dog构造函数公布出去